/**
 * 游戏相关数据
 *
 * @author li.youxi
 * @date 2017/06/02
 */

//形状模型数据
var shape = {
	noshape: 0,
	zshape: 1,
	sshape: 2,
	lineshape: 3,
	tshape: 4,
	squareshape: 5,
	lshape: 6,
	mirroredlshape: 7
};

//形状的颜色
var colors = ['black', 'fuchsia', '#cff', 'red', 'orange', 'aqua', 'green', 'yellow'];

//各种形状的数据描述
var Shapes = [
	[[0, 0], [0, 0], [0, 0], [0, 0]],
	[[0, -1], [0, 0], [-1, 0], [-1, 1]],
	[[0, -1], [0, 0], [1, 0], [1, 1]],
	[[0, -1], [0, 0], [0, 1], [0, 2]],
	[[-1, 0], [0, 0], [1, 0], [0, 1]],
	[[0, 0], [1, 0], [0, 1], [1, 1]],
	[[-1, -1], [0, -1], [0, 0], [0, 1]],
	[[1, -1], [0, -1], [0, 0], [0, 1]]
];


//将形状自身的坐标系转换为Map的坐标系，row col为当前形状原点在Map中的位置
function translate(data, row, col) {
	var copy = []
		i = 0,
		len = data.length;

	for(; i<len; i++) {
		//每次循环不会被覆盖？
		var temp = {};
		temp.row = data[i][1] + row;
		temp.col = data[i][0] + col;
		copy.push(temp);
	}
}

//向右旋转一个形状：x1 = y, y1 = -x
function rotate(data) {
	var copy = [[],[],[],[]];

	for(var i=0; i<4; i++) {
		copy[i][0] = data[i][1];
		copy[i][1] = -data[i][0];
	}

	return copy;
}

//





























